﻿using Anke.SHManage.MSSQLDAL;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class AcceptEventTaskPrintModeWebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Data_Binding();
            }
        }

        private void Data_Binding()
        {
            string PEventCode = Request.QueryString["PEventCode"];

            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/PrintEventDetial.rdlc");
            EventPrintDAL evdal = new EventPrintDAL();
            //受理信息
            DataTable dt = evdal.GetPrintAcceptEventInfoByCode(PEventCode);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrint_AcceptDetial", dt));
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrintEventDetial2", dt));
            //电话信息
            DataTable dt2 = evdal.GetPrintAlarmCalls(PEventCode);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrint_AlarmCallDetial", dt2));
            //事件信息
            DataTable evdt = evdal.GetPrintAlarmEventInfoByCode(PEventCode);
            //DataTable acdt = evdal.GetPrintAcceptEventInfoByCode(PEventCode);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrintEventDetial1", evdt));
            //任务信息
            DataTable dt3 = evdal.GetPrintTaskAmbulance(PEventCode);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrintTaskDetial", dt3));
            //DataTable dt4 = evdal.GetPrintGreenDate(PEventCode);
            //this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForPrintGreenDate", dt4));
            this.ReportViewer1.LocalReport.Refresh();
        }

    }
}